﻿package 
{
    import U.*;
    import core.resource.json.*;
    import core.ui.controls.*;
    import flash.events.*;
    import flash.external.*;
    import flash.net.*;
    import flash.utils.*;

    public class U extends Object
    {
        static var ed:Tuyitu;
        static var url:String = "";
        static var res:Dictionary = null;
        static var param:Dictionary = null;
        public static var loader:URLLoader;

        public function U()
        {
            return;
        }// end function

        public static function Init(ExternalInterface:Tuyitu) : void
        {
            ed = ExternalInterface;
            url = ExternalInterface.available ? (ExternalInterface.call("document.location.toString")) : ("");
            SetDefaultResource();
            ParseQueryString();
            return;
        }// end function

        public static function Log(ExternalInterface:String) : void
        {
            if (ExternalInterface.available)
            {
                ExternalInterface.call("pageTracker._trackEvent(\'Tuyitu\', \'" + ExternalInterface + "\')");
            }
            return;
        }// end function

        public static function CallHome(ExternalInterface:String, ExternalInterface:Object, ExternalInterface:Function) : void
        {
            var param1:* = ExternalInterface;
            var param2:* = ExternalInterface;
            var param3:* = ExternalInterface;
            var action:* = param1;
            var data:* = param2;
            var callback:* = param3;
            if (loader != null)
            {
                loader.close();
                loader = null;
            }
            loader = new URLLoader();
            loader.addEventListener(Event.COMPLETE, function (event:Event)
            {
                callback(U.JSONResult(event.target.data));
                return;
            }// end function
            );
            loader.addEventListener(IOErrorEvent.IO_ERROR, function (event:IOErrorEvent)
            {
                new AlertDialog(ed, "rm_error");
                return;
            }// end function
            );
            loader.load(new URLRequest(ed.context + "/bridge/?data=" + U.JSONCommand(action, data)));
            return;
        }// end function

        public static function Connect(ExternalInterface:String, ExternalInterface:Function) : void
        {
            if (ExternalInterface.available)
            {
                ed.Connection();
                ExternalInterface.addCallback("auth", ExternalInterface);
                ExternalInterface.call("Auth", ExternalInterface);
            }
            else
            {
                U.ExternalInterface("{\"sucess\":false, \"payload\":\"err:no_external_interface\"}");
            }
            return;
        }// end function

        public static function Clipboard(ExternalInterface:Function) : void
        {
            if (ExternalInterface.available)
            {
                ExternalInterface.addCallback("clipboard", ExternalInterface);
                ExternalInterface.call("Clipboard");
            }
            else
            {
                U.ExternalInterface("err:no_external_interface");
            }
            return;
        }// end function

        public static function TrashBack(ExternalInterface:Object) : void
        {
            return;
        }// end function

        public static function GetLocalData(available:String) : String
        {
            var _loc_2:String = null;
            var _loc_3:* = SharedObject.getLocal("tuyitu");
            for (_loc_2 in _loc_3.data)
            {
                
                if (_loc_2 == available)
                {
                    return _loc_3.data[_loc_2];
                }
            }
            return "";
        }// end function

        public static function SetLocalData(ExternalInterface:String, ExternalInterface:String) : void
        {
            var _loc_3:* = SharedObject.getLocal("tuyitu");
            _loc_3.data[ExternalInterface] = ExternalInterface;
            _loc_3.flush();
            return;
        }// end function

        public static function RM(available:String) : String
        {
            return res != null && res[available] != null ? (res[available]) : (available);
        }// end function

        public static function ParseResource(ExternalInterface:String) : void
        {
            var _loc_2:Array = null;
            var _loc_4:int = 0;
            var _loc_3:* = ExternalInterface.split("\n");
            while (_loc_4 < _loc_3.length)
            {
                
                _loc_2 = _loc_3[_loc_4].split("§");
                if (_loc_2.length > 1)
                {
                    res[(_loc_2[0] as String).replace(/^\s+|\s+$""^\s+|\s+$/g, "")] = (_loc_2[1] as String).replace(/^\s+|\s+$""^\s+|\s+$/g, "");
                }
                _loc_4++;
            }
            return;
        }// end function

        public static function SetDefaultResource() : void
        {
            res = new Dictionary(true);
            res["rm_size"] = "大小:";
            res["rm_amount"] = "合计:";
            res["rm_strength"] = "强度:";
            res["rm_brush"] = "笔刷:";
            res["rm_opacity"] = "不透明度:";
            res["rm_range"] = "范围:";
            res["rm_color"] = "颜色:";
            res["rm_anchor"] = "锚点:";
            res["rm_level"] = "色阶:";
            res["rm_exposure"] = "曝光度:";
            res["rm_tolerance"] = "容差:";
            res["rm_multiplier"] = "倍增:";
            res["rm_point_size"] = "点大小:";
            res["rm_height"] = "高度:";
            res["rm_width"] = "宽度:";
            res["rm_pixels"] = "像素";
            res["rm_shadows"] = "阴影";
            res["rm_midtones"] = "中间调";
            res["rm_highlights"] = "高亮";
            res["rm_aligned"] = "对齐";
            res["rm_contiguous"] = "连续";
            res["rm_tools"] = "工具";
            res["rm_navigator"] = "导航器";
            res["rm_layers"] = "图层";
            res["rm_no_additional_options"] = "此工具无其他选项";
            res["rm_rasterize_before_edit"] = "此图层必须栅格化才能编辑";
            res["rm_sample_all_layers"] = "对所有图层取样";
            res["rm_all_layers"] = "所有图层";
            res["rm_inverse"] = "反向";
            res["rm_small_copy"] = "复制";
            res["rm_delete_layer"] = "删除图层";
            res["rm_new_layer"] = "新图层";
            res["rm_duplicate_layer"] = "复制图层";
            res["rm_open_image_as_layer"] = "打开图像为图层";
            res["rm_open_url_as_layer"] = "打开图像网址为图层";
            res["rm_open_library_as_layer"] = "从图库中打开为图层";
            res["rm_alert"] = "警告";
            res["rm_ok"] = "确定";
            res["rm_cancel"] = "取消";
            res["rm_progress"] = "进度";
            res["rm_art_poster"] = "艺术海报";
            res["rm_brightness_contrast"] = "亮度与对比度";
            res["rm_brightness"] = "亮度:";
            res["rm_contrast"] = "对比度:";
            res["rm_canvas_size"] = "画布大小";
            res["rm_diffuse"] = "漫射";
            res["rm_halftone"] = "半色调";
            res["rm_hue_saturation"] = "色相与饱和度";
            res["rm_hue"] = "色相:";
            res["rm_saturation"] = "饱和度:";
            res["rm_lightness"] = "亮度:";
            res["rm_colorize"] = "着色";
            res["rm_desaturate"] = "去色";
            res["rm_saturate"] = "饱和";
            res["rm_invert"] = "反转";
            res["rm_blur"] = "模糊";
            res["rm_sharpen"] = "锐化";
            res["rm_image_size"] = "图像尺寸";
            res["rm_constrain_proportions"] = "约束比例";
            res["rm_name"] = "名称:";
            res["rm_untitled"] = "未命名";
            res["rm_transparent"] = "透明";
            res["rm_noise"] = "噪度";
            res["rm_emboss"] = "浮雕";
            res["rm_engrave"] = "雕刻";
            res["rm_monocromatic"] = "单色";
            res["rm_images"] = "图片";
            res["rm_loading_image"] = "导入图像";
            res["rm_error"] = "发生了一个错误，请稍候再试！";
            res["rm_delete"] = "删除";
            res["rm_pixelate"] = "像素化";
            res["rm_cell_size"] = "单元尺寸";
            res["rm_posterize"] = "色调分离";
            res["rm_save_image"] = "保存图像";
            res["rm_quality"] = "质量:";
            res["rm_format"] = "格式:";
            res["rm_scanlines"] = "扫描线";
            res["rm_horizontal"] = "水平";
            res["rm_threshold"] = "阈值";
            res["rm_sepia"] = "颜料";
            res["rm_water_swirl"] = "水涡";
            res["rm_set_background_color"] = "设置背景色";
            res["rm_set_foreground_color"] = "设置前景色";
            res["rm_switch_colors"] = "颜色互换";
            res["rm_default_colors"] = "默认颜色";
            res["rm_marquee_tool"] = "选框工具";
            res["rm_move_tool"] = "移动工具";
            res["rm_wand_tool"] = "魔棒工具";
            res["rm_lasso_tool"] = "套索工具";
            res["rm_crop_tool"] = "裁剪工具";
            res["rm_brush_tool"] = "画笔工具";
            res["rm_pencil_tool"] = "铅笔工具";
            res["rm_fill_tool"] = "油漆桶工具";
            res["rm_clone_tool"] = "仿制图章工具";
            res["rm_type_tool"] = "文字工具";
            res["rm_blur_tool"] = "模糊工具";
            res["rm_sharpen_tool"] = "锐化工具";
            res["rm_smudge_tool"] = "涂抹工具";
            res["rm_sponge_tool"] = "海绵工具";
            res["rm_dodge_tool"] = "减淡工具";
            res["rm_burn_tool"] = "加深工具";
            res["rm_red_eye_tool"] = "消红眼工具";
            res["rm_bloat_tool"] = "膨胀工具";
            res["rm_pinch_tool"] = "收缩工具";
            res["rm_color_picker_tool"] = "拾色工具";
            res["rm_eraser_tool"] = "橡皮擦工具";
            res["rm_hand_tool"] = "手形工具";
            res["rm_zoom_tool"] = "缩放工具";
            res["rm_gradient_tool"] = "渐变工具";
            res["rm_clone_not_defined"] = "无法使用仿制图章，因为要仿制的区域为定义（按住Ctrl键来定义源点）";
            res["rm_file"] = "文件";
            res["rm_edit"] = "编辑";
            res["rm_image"] = "图像";
            res["rm_layer"] = "图层";
            res["rm_background"] = "背景";
            res["rm_adjustment"] = "调整";
            res["rm_filter"] = "滤镜";
            res["rm_view"] = "视图";
            res["rm_language"] = "选择语言";
            res["rm_help"] = "帮助";
            res["rm_liping"] = "我的照片礼物";
            res["rm_open"] = "打开";
            res["rm_new_image"] = "新建图像";
            res["rm_open_image"] = "打开图片";
            res["rm_open_from_url"] = "打开图片网址";
            res["rm_open_from_library"] = "打开图片库";
            res["rm_login"] = "登录";
            res["rm_logout"] = "注销";
            res["rm_register"] = "注册";
            res["rm_settings"] = "会员中心";
            res["rm_lost_password"] = "忘记密码";
            res["rm_register_account"] = "注册图艺图-在线PS";
            res["rm_welcome_to_tuyitu"] = "欢迎光临图艺图，您现在可以开始保存您的分层源文件、模板和其他图片";
            res["rm_email"] = "邮箱（必填方便激活）:";
            res["rm_password"] = "密码:";
            res["rm_remember_me"] = "记住密码";
            res["rm_password_repeat"] = "重复密码:";
            res["rm_insert_data"] = "请填写所有字段";
            res["rm_password_mismatch"] = "提供的密码不匹配";
            res["rm_login_fail"] = "提供的邮箱和密码组合不正确！";
            res["rm_email_exists"] = "用户名或者邮箱已被占用，请修改注册信息重新提交。";
            res["rm_lost_password_desc"] = "请提供您的邮箱地址，我们将向您发送有关重设密码的信息！";
            res["rm_email_do_not_exist"] = "未找到您所提供的邮箱地址的任何记录，请重新检查您输入的信息。";
            res["rm_lost_password_mail_sent"] = "一封包含创建新密码步骤指示的电子邮件已发送到您提供的邮箱地址。";
            res["rm_image_library"] = "我的素材库";
            res["rm_loading_list"] = "载入列表..";
            res["rm_loading_images"] = "加载图片..";
            res["rm_no_folders"] = "无文件夹..";
            res["rm_no_images"] = "此文件夹是空的..";
            res["rm_open_image_and_stay"] = "在图像后打开";
            res["rm_delete_folder"] = "删除文件夹";
            res["rm_confirm_delete_folder"] = "您真的要删除此文件夹及其中包含的所有图片？";
            res["rm_create_folder"] = "新建文件夹";
            res["rm_rename_folder"] = "重命名文件夹";
            res["rm_delete_image"] = "删除图片";
            res["rm_confirm_delete_image"] = "您真的要删除此图片？";
            res["rm_rename_image"] = "重命名图片";
            res["rm_allow_pop_up"] = "请确保您允许来自图艺图tuyitu.com的弹出窗口";
            res["rm_connect_qqapi"] = "将图艺图—在线PS连接到您的腾讯QQ相册";
            res["rm_connect_sina"] = "将图艺图—在线PS连接到您的新浪账户";
            res["rm_folder"] = "文件夹:";
            res["rm_save"] = "保存";
            res["rm_my_computer"] = "我的电脑";
            res["rm_description"] = "说明:";
            res["rm_close"] = "关闭";
            res["rm_max"] = "最大化";
            res["rm_min"] = "最小化";
            res["rm_exit"] = "退出";
            res["rm_undo"] = "撤销";
            res["rm_redo"] = "重做";
            res["rm_history"] = "历史记录";
            res["rm_cut"] = "剪切";
            res["rm_copy"] = "复制";
            res["rm_paste"] = "粘贴";
            res["rm_select_all"] = "全选";
            res["rm_deselect_all"] = "取消全选";
            res["rm_invert_selection"] = "反选";
            res["rm_rotate_canvas_180"] = "将画布旋转180度°";
            res["rm_rotate_canvas_90_cw"] = "将画布顺时针旋转90度";
            res["rm_rotate_canvas_90_ccw"] = "将画布逆时针旋转90度";
            res["rm_flip_canvas_vertical"] = "垂直翻转画布";
            res["rm_flip_canvas_horizontal"] = "水平翻转画布";
            res["rm_merge_down"] = "向下合并";
            res["rm_merge_visible"] = "合并可见";
            res["rm_flatten_image"] = "拼合图像";
            res["rm_rasterize_layer"] = "栅格化图层";
            res["rm_rotate_layer_180"] = "将图层旋转180度";
            res["rm_rotate_layer_90_cw"] = "将图层顺时针旋转90度";
            res["rm_rotate_layer_90_ccw"] = "将图层逆时针旋转90度";
            res["rm_flip_layer_vertical"] = "垂直翻转图层";
            res["rm_flip_layer_horizontal"] = "水平翻转图层";
            res["rm_zoom_in"] = "放大";
            res["rm_zoom_out"] = "缩小";
            res["rm_show_all"] = "显示全部";
            res["rm_actual_pixels"] = "实际像素";
            res["rm_tool_options"] = "工具选项";
            res["rm_fullscreen_mode"] = "全屏模式";
            res["rm_reset_palette_location"] = "重置调色板位置";
            res["rm_help"] = "帮助";
            res["rm_faq"] = "常见问题";
            res["rm_blog"] = "博客";
            res["rm_contact"] = "联系我们";
            res["rm_create_new_brush"] = "创建笔刷";
            res["rm_remove_brush"] = "删除笔刷";
            res["rm_colorpicker"] = "拾色器";
            res["rm_brush_editor"] = "笔刷编辑器";
            res["rm_type"] = "类型:";
            res["rm_radie"] = "半径:";
            res["rm_spikes"] = "尖突:";
            res["rm_hardness"] = "硬度:";
            res["rm_aspect"] = "方向:";
            res["rm_angle"] = "角度:";
            res["rm_spacing"] = "间距:";
            res["rm_font"] = "字体:";
            res["rm_style"] = "样式:";
            res["rm_regular"] = "常规";
            res["rm_bold"] = "粗体";
            res["rm_italic"] = "斜体";
            res["rm_mode"] = "模式:";
            res["rm_referrer"] = "来路";
            res["rm_api"] = "API";
            res["rm_move_layer_up"] = "向上移动图层";
            res["rm_move_layer_down"] = "向下移动图层";
            res["rm_crop"] = "裁剪";
            res["rm_scatter"] = "分散";
            res["rm_confirm"] = "确认";
            res["rm_yes"] = "是";
            res["rm_no"] = "否";
            res["rm_save_before_close"] = "关闭前您要保存图片吗？";
            res["rm_layer_style"] = "图层样式";
            res["rm_kaleidoscope"] = "万花筒";
            res["rm_vertical"] = "垂直";
            res["rm_drop_shadow"] = "阴影";
            res["rm_inner_shadow"] = "内侧阴影";
            res["rm_bevel"] = "斜角";
            res["rm_outer_glow"] = "外发光";
            res["rm_inner_glow"] = "内发光";
            res["rm_distance"] = "距离:";
            res["rm_inner"] = "内";
            res["rm_outer"] = " 外";
            res["rm_full"] = "全局";
            res["rm_free_transform"] = "自由变换";
            res["rm_free_distort"] = "自由变形";
            res["rm_apply_changes"] = "是否应用修改？";
            res["rm_rgb"] = "RBG";
            res["rm_red"] = " 红";
            res["rm_green"] = "绿";
            res["rm_blue"] = "蓝";
            res["rm_levels"] = "色阶";
            res["rm_new_from_clipboard"] = "从剪贴板创建图像";
            res["rm_pastel"] = "蜡笔";
            res["rm_channel"] = "通道:";
            res["rm_input_levels"] = "输入色阶:";
            res["rm_output_levels"] = "输出色阶:";
            res["rm_gradient"] = "渐变:";
            res["rm_linear"] = "线性";
            res["rm_radial"] = "径向";
            res["rm_remove_gradient"] = "删除渐变";
            res["rm_create_new_gradient"] = "创建新的渐变";
            res["rm_spread_method"] = "扩散方式:";
            res["rm_pad"] = "浸染";
            res["rm_reflect"] = "反射";
            res["rm_repeat"] = "重复";
            res["rm_cross_process"] = "交叉冲印";
            res["rm_fill_shape"] = "填充形状";
            res["rm_border_size"] = "边缘大小:";
            res["rm_drawing_tool"] = "绘图工具";
            res["rm_draw_rect"] = "矩形工具";
            res["rm_draw_ellipse"] = "椭圆工具";
            res["rm_draw_round_rect"] = "圆角矩形工具";
            res["rm_draw_line"] = "线形工具";
            res["rm_heatmap"] = "热图";
            res["rm_tilt_shift"] = "移轴镜头";
            res["rm_focus_size"] = "焦点大小:";
            res["rm_focus_location"] = "焦点位置:";
            res["rm_saturate"] = "饱和";
            res["rm_vignette"] = "虚光镜头";
            res["rm_curves"] = "曲线";
            res["rm_histogram"] = "直方图";
            res["rm_presets"] = "预置:";
            res["rm_double_click_to_unlock_layer"] = "双击解锁图层";
            res["rm_create_new_image"] = "创建一张新图片";
            res["rm_create_new_image_desc"] = "从一张空白图片开始或从剪贴板开始";
            res["rm_open_image_from_computer"] = "从电脑上打开照片";
            res["rm_open_image_from_computer_desc"] = "浏览您的电脑选择一张图像";
            res["rm_open_image_from_url"] = "打开一张网络中的图片地址";
            res["rm_open_image_from_url_desc"] = "指定图片的详细网址";
            res["rm_open_image_from_library"] = "从网络相册中打开一张图片";
            res["rm_open_image_from_library_desc"] = "来自图艺图、QQ相册或其他PSD素材图片";
            res["rm_pointinize"] = "点状化";
            res["rm_squares"] = "方形";
            res["rm_large_circles"] = "大圈";
            res["rm_small_circles"] = "小圈";
            res["rm_dots"] = "点";
            res["rm_sample_white_point"] = "从图片取样设置白点";
            res["rm_sample_grey_point"] = "从图片取样设置灰点";
            res["rm_sample_black_point"] = "从图片取样设置黑点";
            res["rm_selection_move"] = " 移动选区";
            res["rm_move"] = "移动";
            res["rm_layer_merge"] = "合并图层";
            res["rm_clear"] = "清除";
            res["rm_layer_order"] = "图层顺序";
            res["rm_flip_canvas"] = "翻转画布";
            res["rm_tritone"] = "三色调";
            res["rm_auto_levels"] = "自动色阶";
            res["rm_color_lookup"] = "颜色查找";
            res["rm_rotate_canvas"] = "旋转画布";
            res["rm_print"] = "打印";
            res["rm_rotate_layer"] = "旋转图层";
            res["rm_lasso_freehand"] = "自由套索工具";
            res["rm_lasso_polygon"] = "多边形套索工具";
            res["rm_copy_layer_style"] = "复制图层样式";
            res["rm_paste_layer_style"] = "粘贴图层样式";
            res["rm_clear_layer_style"] = "清除图层样式";
            res["rm_red_eye_description"] = "在每只眼睛中间点击消除红眼";
            res["rm_denoise"] = "降噪";
            res["rm_layer_opacity"] = "图层不透明度";
            res["rm_paste_layer"] = "粘贴图层";
            res["rm_add_layer_mask"] = "添加图层蒙版";
            res["rm_apply_layer_mask"] = "应用图层蒙版";
            res["rm_delete_layer_mask"] = "删除图层蒙版";
            res["rm_anti_alias"] = "消除锯齿";
            res["rm_feather"] = "羽化:";
            res["rm_share_done"] = "去定制我的照片礼物";
            res["rm_share_info"] = "您的图片已保存，复制网址分享它，或点击此链接DIY自己的礼物。";
            res["rm_jpeg"] = "JPEG (常用的图片格式)";
            res["rm_png"] = "PNG（透明，全品质图像）";
            res["rm_bmp"] = "BMP（无损大图）";
            res["rm_tud"] = "TUD（分层源文件TUD格式）";
            res["rm_gif"] = "GIF（动态图片..）";
            res["rm_url"] = "输入图片详细的URL:";
            res["rm_working"] = "正在生成请稍候...";
            res["rm_flip_layer"] = "翻转图层";
            res["rm_text"] = "文字:";
            res["rm_type_description"] = "单击以选中或添加文本";
            res["rm_define_brush"] = "定义笔刷";
            res["rm_load_brush_set"] = "载入设置";
            res["rm_save_brush_set"] = "保存设置";
            res["rm_reset"] = "重设";
            res["rm_brush_defined"] = "笔刷定义";
            res["rm_brush_browser"] = "笔刷浏览器";
            res["rm_diameter"] = "直径:";
            res["rm_browse_brush_sets"] = "更多..";
            res["rm_add"] = "新增";
            res["rm_marquee_rectangular"] = "矩形选框";
            res["rm_marquee_elliptical"] = "椭圆选框";
            res["rm_brushes"] = "笔刷";
            res["rm_find_edges"] = "查找边缘";
            res["rm_color_replace_tool"] = "颜色替换工具";
            res["rm_match_lightness"] = "匹配目标亮度";
            res["rm_box_blur"] = "方框模糊";
            res["rm_gaussian_blur"] = "高斯模糊";
            res["rm_hope"] = "霍普";
            res["rm_glamour_glow"] = "魅力光晕";
            res["rm_solarize"] = "曝光过度";
            res["rm_mimic_hdr"] = "模拟高动态范围图像";
            res["rm_exposuree"] = "曝光度";
            res["rm_polar_coordinates"] = "极坐标";
            res["rm_rect_to_polar"] = "直角坐标转化为极坐标";
            res["rm_polar_to_rect"] = "极坐标转化为直角坐标";
            res["rm_invert_in_circle"] = "反转圆环";
            res["rm_unsharp_mask"] = "锐化蒙版";
            res["rm_old_photo"] = "老照片";
            res["rm_clipboard"] = "剪贴板";
            res["rm_constraint"] = "约束:";
            res["rm_no_restriction"] = "无限制";
            res["rm_aspect_ratio"] = "长宽比";
            res["rm_output_size"] = "输出尺寸";
            res["rm_brush_size_larger"] = "较大的笔刷";
            res["rm_brush_size_smaller"] = "较小的笔刷";
            res["rm_brush_hardness_harder"] = "较硬的笔刷";
            res["rm_brush_hardness_softer"] = "较软的笔刷";
            res["rm_spot_heal_tool"] = "点修复工具";
            res["rm_no_clipboard"] = "没有剪贴板数据";
            return;
        }// end function

        private static function ParseQueryString() : void
        {
            var _loc_1:String = null;
            var _loc_2:Array = null;
            var _loc_3:int = 0;
            var _loc_4:String = null;
            var _loc_5:String = null;
            param = new Dictionary(true);
            if (url != null && url.indexOf("?") != -1)
            {
                _loc_2 = url.split("?")[1].split("&");
                _loc_3 = 0;
                while (_loc_3 < _loc_2.length)
                {
                    
                    _loc_4 = _loc_2[_loc_3].split("=")[0];
                    _loc_5 = decodeURIComponent(_loc_2[_loc_3].split("=")[1]);
                    param[_loc_4] = _loc_5;
                    _loc_3++;
                }
            }
            var _loc_6:* = ed.root.loaderInfo.parameters;
            for (_loc_1 in _loc_6)
            {
                
                param[_loc_1] = _loc_6[_loc_1];
            }
            return;
        }// end function

        public static function IsParam(load:String) : Boolean
        {
            return Boolean(Param(load) != "");
        }// end function

        public static function IsParamTrue(load:String) : Boolean
        {
            return Boolean(Param(load, true) == "true");
        }// end function

        public static function Param(available:String, available:Boolean = false) : String
        {
            return param[available] != null ? (available ? (param[available].toLowerCase()) : (param[available])) : ("");
        }// end function

        public static function getPageURL(available:String) : String
        {
            var photo:* = available;
            if (ExternalInterface.available)
            {
                try
                {
                    photo = ExternalInterface.call("eval", "window.location.href");
                    photo = photo.split("?photo=")[1];
                    if (photo != null)
                    {
                        return photo;
                    }
                    return "";
                }
                catch (e:Error)
                {
                    return "";
                }
            }
            return "";
        }// end function

        public static function JSONCommand(available:String, available:Object) : String
        {
            var _loc_3:* = undefined;
            var _loc_4:* = "{\"action\":\"" + available + "\",";
            _loc_4 = _loc_4 + "\"payload\":{";
            for (_loc_3 in available)
            {
                
                _loc_4 = _loc_4 + ("\"" + _loc_3 + "\":\"" + encodeURIComponent(available[_loc_3]) + "\",");
            }
            _loc_4 = _loc_4.substr(0, (_loc_4.length - 1)) + "}}";
            return _loc_4;
        }// end function

        public static function JSONResult(core.enum:String) : Object
        {
            return new JSONDecoder(core.enum, true).getValue();
        }// end function

        public static function Clone(param1:Object)
        {
            var _loc_2:* = new ByteArray();
            _loc_2.writeObject(param1);
            _loc_2.position = 0;
            return _loc_2.readObject();
        }// end function

        public static function CleanString(available:String) : String
        {
            available = available.split("<").join("");
            available = available.split(">").join("");
            available = available.split("%").join("");
            available = available.split(",").join("");
            available = available.split("%").join("");
            available = available.split("/").join("");
            available = available.split("\\").join("");
            return available;
        }// end function

    }
}
